![]() |
ZoomWindowIdeal |
||||
Header: | MacWindows.h | Carbon status: | Supported | |
Zooms a window in accordance with human interface guidelines.
OSStatus ZoomWindowIdeal ( WindowRef window, SInt16 partCode, Point *ioIdealSize );
A pointer to the window to be zoomed.
A value specifying the direction of the zoom being requested. Your application passes in the relevant value (either the inZoomIn or the inZoomOut constant).
When you specify inZoomIn in the partCode parameter, you pass a pointer to the Point structure, but do not fill the structure with data. On return, the Point structure contains the new height and width of the window’s content region, and ZoomWindowIdeal restores the previous user state.
When you specify inZoomOut in the partCode parameter, you pass the ideal height and width of the window’s content region in the Point structure. On return, the Point structure contains the new height and width of the window’s content region; ZoomWindowIdeal saves the user state of the window and zooms the window to its ideal size for the standard state.
A result code.
Applications should use the ZoomWindowIdeal function instead of the older function ZoomWindow. When your application calls ZoomWindowIdeal, it automatically conforms to the human interface guidelines for determining a window’s standard state.
The ZoomWindowIdeal function calculates a window’s ideal standard state and updates a window’s ideal user state independently of the WStateData structure. Previously, the window definition function was responsible for updating the user state, but because it relies upon the WStateData structure, the window definition function is unaware of the ideal standard state and can no longer track the window’s zoom state reliably.
While the Window Manager is reliably aware of the window’s zoom state, it cannot record the current user state in the WStateData structure, because the window definition function can overwrite that data. Therefore, if your application uses ZoomWindowIdeal, the WStateData structure is superseded, and the result of the FindWindow function should be ignored when determining whether a particular user click of the zoom box is a request to zoom in or out. When you adopt ZoomWindowIdeal and your application receives a result of either inZoomIn or inZoomOut from FindWindow, your application must use the function IsWindowInStandardState to determine the appropriate part code to pass in the partCode parameter.
This function is available with Mac OS 8.5 and later.
Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)